﻿using System;
using System.ServiceModel;
using System.ServiceModel.Activation;

namespace TaskClient5.Web
{
    [ServiceContract(Namespace = "http://www.cnblogs.com/lemontea/")]
    [AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)]
    public class SystemService
    {
        [OperationContract]
        public void DoWork()
        {
            return;
        }

        [OperationContract]
        public DateTime GetSerivceTime()
        {
            return DateTime.Now;
        }

        [OperationContract]
        public string SayHiTo(string name)
        {
            if (string.IsNullOrWhiteSpace(name))
                throw new ArgumentNullException("name");

            return string.Format("Hi,{0}!", name);
        }

        [OperationContract]
        public decimal GetNum(decimal num)
        {
            return 5 / num;
        }
    }
}